package com.miplus.ccrm.core.service.strategy;

import com.baomidou.mybatisplus.core.metadata.IPage;
import com.github.yulichang.base.MPJBaseService;
import com.miplus.ccrm.common.CmdResVo;
import com.miplus.ccrm.common.PageData;
import com.miplus.ccrm.common.R;
import com.miplus.ccrm.core.controller.vo.LabelResVo;
import com.miplus.ccrm.core.controller.vo.strategy.*;
import com.miplus.ccrm.core.pojo.CfgRuleConditions;
import com.miplus.ccrm.core.pojo.CfgRuleTaskSteps;
import com.baomidou.mybatisplus.extension.service.IService;
import org.springframework.validation.annotation.Validated;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;

import java.util.List;

/**
* @author wangzl
* @description 针对表【cfg_rule_task_steps】的数据库操作Service
* @createDate 2024-10-22 10:35:02
*/
public interface CfgRuleTaskStepsService extends MPJBaseService<CfgRuleTaskSteps> {
    IPage<RuleStepListResVo> getRuleStepList(String usrId, RuleStepListReqVo ruleStepListReqVo);

    List<LabelResVo> getRuleStepSelectList(Integer actionCode);
    RuleStepResVo getRuleStepInfo(Long ruleStepId);

    /**
     * 获取条件列表
     */
    List<CfgRuleConditions> getRuleConditionList(Long ruleStepId);

    CmdResVo addRuleStep(String usrId, RuleStepReqVo vo);
    /**
     * 更新策略。
     */
    CmdResVo updateRuleStep(String usrId, RuleStepReqVo vo );

    /**
     * 删除策略。
     */
    CmdResVo deleteRuleStep( Long ruleStepId );

    /**
     * 增加条件。
     */
    CmdResVo addRuleCondition(String usrId,  Long ruleStepId, CfgRuleConditions cfgRuleConditions);

    /**
     * 更新条件。
     */
   CmdResVo updateRuleCondition(String usrId, CfgRuleConditions cfgRuleConditions);
    /**
     * 删除条件。
     */
    CmdResVo deleteRuleCondition(String usrId, Long ruleConditionId );

    /**
     * 检查
     * @param ruleStepId
     * @return
     */
    CmdResVo checkRuleStep(Long ruleStepId);

    String getExcludeBlackSql(CfgRuleTaskSteps cfgRuleTaskSteps);

    CmdResVo runRuleStep(String usrid,Long ruleStepId,Integer isForce);

    CmdResVo runRuleStep(String usrid, CfgRuleTaskSteps cfgRuleTaskSteps);

}
